<!-- 查询条件Begin -->
<form class="form-inline search-form-bottom-border">
    <div class="form-group ext-from-item">
        <label for="xjStatus">证券状态：</label>
        <!-- <select class="form-control" id="vcNewstockStatusS" name="vcNewstockStatusS" [(ngModel)]="searchBody.vcNewstockStatus">
            <option value="">请选择</option>
            <option *ngFor="let status of newStockStatus;" [value]="status.vcItemKey">{{status.vcItemValue}}</option>
        </select> -->
        <select class="form-control" id="vcNewstockStatusS" name="vcNewstockStatusS" [(ngModel)]="searchBody.vcNewstockStatus">
            <option value="">请选择</option>
            <option value="0">录入询价信息</option>
            <option value="1">启动询价</option>
            <option value="3">基金经理确认</option>
            <option value="5">执行询价</option>
            <option value="6">确认入围</option>
        </select>
    </div>
    <div class="form-group ext-from-item">
        <label for="stockId">证券代码：</label>
        <input type="text" class="form-control" id="vcNewstockIdS" name="vcNewstockIdS" placeholder="证券代码" [(ngModel)]="searchBody.vcNewstockId">
    </div>
    <div class="form-group ext-from-item">
        <button class="btn btn-primary" (click)="search()">查询</button>
        <button class="btn btn-warning" (click)="resetSearch()">重置</button>
    </div>
</form>
<!-- 查询条件 End -->
<!--新股询价列表Begin-->
<div class="panel border-panel-list" *ngFor="let newStock of newStockList; let i = index;">
    <div class="with-border">
        <div class="row">
            <div class="col-md-5">
                <div>
                    <input type="checkbox" [(ngModel)]="newStock.isChecked"/>
                    <span *ngIf="!newStock.isOpen" class="glyphicon glyphicon-plus-sign" (click)="getInquiryListById(newStock.lNewstockNo,i,true)"></span>
                    <span *ngIf="newStock.isOpen" class="glyphicon glyphicon-minus-sign" (click)="getInquiryListById(newStock.lNewstockNo,i,true)"></span>
                    <a on-mouseover="showConfirmFundMrg('ns'+i)"  on-mouseleave="hideConfirmFundMrg('ns'+i)" id="{{'ns'+i}}" data-placement="bottom" data-html="true" title="<label style='color:red'>未确认经理：</label> {{newStock.unconfirmFundmrgName}} <br> <label style='color:red'>已确认经理：</label><div style='max-height:250px;overflow:hidden'>{{newStock.confirmFundmrgName}}</div>" (click)="getInquiryListById(newStock.lNewstockNo,i,true)">
                         证券代码：{{newStock.vcNewstockId}} 证券名称：{{newStock.vcNewstockName}} ({{newStock.totalFunds}}只基金参与) 状态：{{switchNewStockStatus(newStock.vcNewstockStatus)}}
                    </a> 
                </div>
            </div>
            <div class="col-md-4">
                <div>
                    <span>待提交：{{newStock.toSubmitCount}}</span> 待询价：{{newStock.toInquiryCount}} 询价中： {{newStock.inquiryedCount}} 已入围： {{newStock.rwCount}} 未入围：{{newStock.notRwCount}} 不参与询价：{{newStock.notJoin}}
                </div>
            </div>
            <div class="col-md-3 text-right">
                <button class="btn btn-warning btn-sm" (click)="confirmInquiry(newStock)" *ngIf="newStock.toInquiryCount!=0">执行询价</button>
                <button class="btn btn-success btn-sm" (click)="confirmRW(newStock)" *ngIf="newStock.inquiryedCount!==0">批量入围</button>
                <button class="btn btn-success btn-sm" (click)="recallRW(newStock)" *ngIf="newStock.rwCount!==0">撤销入围</button>
                <button class="btn btn-warning btn-sm" (click)="stopInquiry(newStock)" *ngIf="newStock.vcNewstockStatusName=='执行询价'">结束询价</button>
                <button class="btn btn-primary btn-sm" (click)="submitConfirm(newStock)" *ngIf="newStock.toSubmitCount!=0 && (newStock.toInquiryCount != 0 || newStock.inquiryedCount != 0)">提交(补)</button>
                <button class="btn btn-primary btn-sm" (click)="submitConfirm(newStock)" *ngIf="newStock.toSubmitCount!=0 && newStock.toInquiryCount == 0 && newStock.inquiryedCount == 0">提交</button>
                <!-- <button class="btn btn-primary" (click)="toggleConsultingPriceModalOpen(newStock.lNewstockNo)">批量保存</button> -->
                <button class="btn btn-primary btn-sm" (click)="toggleConsultingPriceModalOpen(newStock.lNewstockNo)">查看</button>
            </div>
        </div>
    </div>
    <div id="{{'ipo' + i}}" class="panel-collapse collapse margin-top-10">
        <div class="fixed-table-container">
            <div class="table-scroll-content form-group">
                <table class="table table-bordered table-keep-line table-hover table-striped">
                    <tr>
                        <th>
                            <input type="checkbox" [(ngModel)]="isCheckedAll" (ngModelChange)="checkedAll(newStock.lNewstockNo)"/>
                        </th>
                        <th>组合代码</th>
                        <th>组合名称</th>
                        <th>询价价格(元)</th>
                        <th>询价数量(股)</th>
                        <th>金额(元)</th>
                        <th>O3基金代码</th>
                        <th>O3基金名称</th>
                        <th>O3证券代码</th>
                        <th>O3证券名称</th>
                        <th>O3询价价格</th>
                        <th>O3询价数量</th>
                        <th>O3询价金额</th>
                        <th>与O3比对结果名称</th>
                        <th>是否参与询价</th>
                        <th>状态</th>
                        <th>是否入围</th>
                        <th>预计冻结金额(元)</th>
                        <th>日均市值(元)</th>
                        <th>基金当前规模(元)</th>
                        <th>基金经理</th>
                        <th>股东账户</th>
                        <th *ngIf="canOperate(4,newStock.vcNewstockStatus)">操作</th>
                    </tr>
                    <tr *ngFor="let inquiry of inquiryList[newStock.lNewstockNo];" [class.highLight]="inquiry.cIsJoin =='0'" [class.highLightGreen]="inquiry.cIsrw =='1'">
                        <td>
                            <!-- 序号 -->
                            <input type="checkbox"  [(ngModel)]="inquiry.isChecked" (ngModelChange)="checked(inquiry,newStock.lNewstockNo)"/>
                        </td>
                        <td>
                            <!-- 组合代码 -->
                            {{inquiry.vcFundCode}}
                        </td>
                        <td>
                            <!-- 组合名称 -->
                            {{inquiry.vcFundName}}
                        </td>
                        <td>
                            <!-- 询价价格 -->
                            {{inquiry.enPrice}}
                        </td>
                        <td *ngIf="!inquiry.isEdited">
                            <!-- 询价数量 -->
                            {{inquiry.lShares}}
                        </td>
                        <td *ngIf="inquiry.isEdited && canOperate(4,newStock.vcNewstockStatus)">
                            <!-- 询价数量 -->
                            <input type="text" class="form-control" id="lSharesL" name="lSharesL" [(ngModel)]="inquiry.lShares" />
                        </td>
                        <td>
                            <!-- 金额 -->
                            {{inquiry.enMoney}}
                        </td>
                        <td>
                            <!-- O3基金代码 -->
                            {{inquiry.vcFundCodeO3}}
                        </td>
                        <td>
                            <!-- O3基金名称 -->
                            {{inquiry.vcFundNameO3}}
                        </td>
                        <td>
                            <!-- O3证券代码 -->
                            {{inquiry.vcNewstockIdO3}}
                        </td>
                        <td>
                            <!-- O3证券名称 -->
                            {{inquiry.vcNewstockNameO3}}
                        </td>
                        <td>
                            <!-- O3询价价格 -->
                            {{inquiry.enPriceO3}}
                        </td>
                        <td>
                            <!-- O3询价数量 -->
                            {{inquiry.lSharesO3}}
                        </td>
                        <td>
                            <!-- O3询价金额 -->
                            {{inquiry.enMoneyO3}}
                        </td>
                        <td>
                            <!-- 与O3比对结果名称 -->
                            {{inquiry.matchResultName}}
                        </td>
                        <td *ngIf="!inquiry.isEdited">
                            <!-- 是否参与询价 -->
                            {{inquiry.cIsJoin == '1' ? '参与' : '不参与' }}
                        </td>
                        <td *ngIf="inquiry.isEdited && canOperate(4,newStock.vcNewstockStatus)">
                            <!-- 是否参与询价 -->
                            <select id="cIsJoinL" name="cIsJoinL" [(ngModel)]="inquiry.cIsJoin">
                                <option value="1">参与</option>
                                <option value="0">不参与</option>
                            </select>
                        </td>
                        <td>
                            <!-- 状态 -->
                            {{inquiry.cDataStatusName}}
                        </td>
                        <td>
                            <!-- 是否入围 -->
                            {{inquiry.cIsrw == 1 ? '是' : inquiry.cIsrw == 0 ? '否' : "" }}
                        </td>
                        <td>
                            <!-- 预计冻结金额 -->
                            {{inquiry.enPredictMoney}}
                        </td>
                        <td>
                            <!-- 日均市值 -->
                            {{inquiry.enAveragevalue}}
                        </td>
                        <td>
                            <!-- 基金当前规模 -->
                            {{inquiry.enFundsacle}}
                        </td>
                        <td>
                            <!-- 基金经理 -->
                            {{inquiry.vcFundmrgName}}
                        </td>
                        <td>
                            <!-- 股东账户 -->
                            {{inquiry.vcStockholderId}}
                        </td>
                        <td *ngIf="canOperate(4,newStock.vcNewstockStatus)">
                            <!-- 操作 -->
                            <button *ngIf="!inquiry.isEdited && inquiry.cDataStatusName == '未提交' " [disabled]="inquiry.cDataStatus !== '1' " type="submit" class="btn btn-primary btn-xs" (click)="toEdit([inquiry])">编辑</button>
                            <button *ngIf="inquiry.isEdited" type="submit" class="btn btn-primary btn-xs" (click)="cancelEdit([inquiry])">取消</button>
                            <button *ngIf="inquiry.isEdited" type="submit" class="btn btn-warning btn-xs" (click)="saveInqurify([inquiry])">保存</button>
                            <button *ngIf="inquiry.cDataStatusName=='询价中'" type="submit" class="btn btn-warning btn-xs" (click)="singleConfirmRW(inquiry)">入围</button>
                            <button *ngIf="inquiry.cDataStatusName=='已入围'" type="submit" class="btn btn-warning btn-xs" (click)="singleConfirmRecallRW(inquiry)">撤销</button>
                        </td>
                    </tr>
                </table>
            </div>
            <!-- 分页 Begin -->
            <div class="clearfix">
                <app-pagination #inquiryPag [currentPageNum]="getInquiryCurPage(newStock.lNewstockNo)" [pagesShow]="" [totalPages]="getInquiryTotalPage(newStock.lNewstockNo)" (pageChanged)="getInquiryListById(newStock.lNewstockNo+'-'+$event,i,false)"></app-pagination>
            </div>
            <!-- 分页 End-->
            <div class="table-fixed-content">
                <table class="table table-bordered table-hover table-striped table-keep-line">
                    <thead>
                        <tr role="row">
                            <th>
                                <input type="checkbox" [(ngModel)]="isCheckedAll" (ngModelChange)="checkedAll(newStock.lNewstockNo)"/>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let inquiry of inquiryList[newStock.lNewstockNo];">
                            <td>
                                <!-- 序号 -->
                                <input type="checkbox"  [(ngModel)]="inquiry.isChecked" (ngModelChange)="checked(inquiry,newStock.lNewstockNo)"/>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="table-fixed-right-content">
                <table class="table table-bordered table-hover table-striped table-keep-line">
                    <thead>
                        <tr role="row">
                            <th *ngIf="canOperate(4,newStock.vcNewstockStatus)">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let inquiry of inquiryList[newStock.lNewstockNo];">
                            <td *ngIf="canOperate(4,newStock.vcNewstockStatus)">
                                <!-- 操作 -->
                                <button *ngIf="!inquiry.isEdited " [disabled]="inquiry.cDataStatus !== '1' " type="submit" class="btn btn-primary btn-xs" (click)="toEdit([inquiry])">编辑</button>
                                <button *ngIf="inquiry.isEdited" type="submit" class="btn btn-primary btn-xs" (click)="cancelEdit([inquiry])">取消</button>
                                <button *ngIf="inquiry.isEdited" type="submit" class="btn btn-warning btn-xs" (click)="saveInqurify([inquiry])">保存</button>
                                <button *ngIf="inquiry.cDataStatusName=='询价中'" type="submit" class="btn btn-warning btn-xs" (click)="singleConfirmRW(inquiry)">入围</button>
                                <button *ngIf="inquiry.cDataStatusName=='已入围'" type="submit" class="btn btn-warning btn-xs" (click)="singleConfirmRecallRW(inquiry)">撤销</button>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--新股询价列表End-->
<!-- 分页 Begin -->
<div class="row nav-tabs-row-padding">
    <app-pagination
        [currentPageNum]="pageInfo.currentPageNum"
        [pagesShow]="pageInfo.pagesShow"
        [totalPages]="pageInfo.totalPages"
        (pageChanged)="pageNavigation($event)">
        <div class="pull-left pagination-detail" data-pagination-additional="true">
            <span class="pagination-info">
                当前显示第{{pageInfo.startRow}}到第{{pageInfo.endRow}}条&nbsp;&nbsp;&nbsp;&nbsp;总共{{pageInfo.total}}条
            </span>
            <span class="page-list">
                <span class="dropup">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        <span class="page-size">{{pageInfo.pageSize}}</span>
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                        <li *ngFor="let i of pageInfo.pageList" role="menuitem"
                            [class.active]="pageInfo.pageSize === i"
                            (click)="pageSizeChange(i)">
                            <a href="javascript:void(0)">{{i}}</a>
                        </li>
                    </ul>
                </span> 
                条记录每一页
            </span>
        </div>
    </app-pagination>
</div>
<!-- 分页 End-->
<!-- 发起询价 Begin-->
<new-stock-purchase-consulting-price [lNewstockNo]="lNewstockNoPara" [operateList]="operateList" (close)="reflesh($event)"></new-stock-purchase-consulting-price>
<!-- 发起询价 End-->
